/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
export enum TsServerLogLevel {
    Off,
    Normal,
    Terse,
    Verbose,
}

export namespace TsServerLogLevel {
    export function fromString(value: string): TsServerLogLevel {
        switch (value && value.toLowerCase()) {
            case 'normal':
                return TsServerLogLevel.Normal;
            case 'terse':
                return TsServerLogLevel.Terse;
            case 'verbose':
                return TsServerLogLevel.Verbose;
            case 'off':
            default:
                return TsServerLogLevel.Off;
        }
    }

    export function toString(value: TsServerLogLevel): string {
        switch (value) {
            case TsServerLogLevel.Normal:
                return 'normal';
            case TsServerLogLevel.Terse:
                return 'terse';
            case TsServerLogLevel.Verbose:
                return 'verbose';
            case TsServerLogLevel.Off:
            default:
                return 'off';
        }
    }
}

export class TypeScriptServiceConfiguration {
    public readonly globalTsdk: string | null;

    public static loadFromWorkspace(tsdk_path: string): TypeScriptServiceConfiguration {
        return new TypeScriptServiceConfiguration(tsdk_path);
    }

    private constructor(tsdk_path: string) {
        this.globalTsdk = tsdk_path;
    }
}
